<template>
	<view>
		<tn-nav-bar :isBack='true' :backTitle='" "' bottomShadow :alpha="alpha">收益明细
		</tn-nav-bar>
		<image src="/static/product/topbg.png" class="topbg" mode=""></image>
		<loading v-if="loading"></loading>
		<view :style="{paddingTop:'calc('+vuex_custom_bar_height+'px + 50rpx)'}" class="con" v-else>
			<view class="con__mx">
				<view class="con__mx__top">
					<image src="/static/my/txng.png" class="con__mx__topbg" mode=""></image>
					<view class="con__mx__top__text">
						{{title}}
					</view>
				</view>
				<scroll-view scroll-y="true" class="con__mx__box">
					<view class="con__mx__list">
						<view class="con__mx__list__item" v-for="(item,index) in list" :key="index">
							<view class="tn-flex tn-flex-col-center">
								<image src="/static/my/txitem.png" class="con__mx__list__item__icon" mode=""></image>
								<view class="con__mx__list__item__center">
									<view class="con__mx__list__item__text">
										{{item.memo}}
									</view>
									<view class="con__mx__list__item__time">
										{{timeFormat(item.createtime,'yyyy.mm.dd hh:MM')}}
										
									</view>
								</view>
							</view>
							<view class="con__mx__list__item__price">
							 <text style="font-family:PingFang-SC-Bold;">+</text>{{item.money}}
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
	</view>
</template>

<script>
	import user from '@/api/_user.js'
	export default {
		data() {
			return {
				alpha:true,
				list:[],
				title:'',
				loading:true
			};
		},
		onLoad(o) {
			this.title=o.name
			
			user.incomeDetail({type:o.type}).then(res=>{
				if(res.data.code==1){
					this.list=res.data.data
					this.loading=false
				}
			})
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F4F4F4;
	}
	.con{
		position: relative;
		&__mx{
			padding: 0 30rpx 66rpx;
			&__top{
				width: 690rpx;
				height: 138rpx;
				position: relative;
				&__text{
					position: relative;
					padding:43rpx 32rpx;
					font-family: AlimamaShuHeiTi;
					font-weight: bold;
					font-size: 32rpx;
					color: #00001C;
					line-height: 30rpx;
				}
			}
			&__topbg{
				width: 690rpx;
				height: 138rpx;
				position: absolute;
				top: 0;
				left: 0;
			}
			&__box{
				width: 690rpx;
				height: calc(100% - 138rpx);
				background: #FFFFFF;
				border-radius: 0rpx 0rpx 30rpx 30rpx;
				
			}
			&__list{
				padding-left: 35rpx;
				&__item{
					padding: 16rpx 36rpx 16rpx 0;
					display: flex;
					align-items: flex-start;
					justify-content: space-between;
					border-bottom: 1rpx solid #F4F4F4;
					&__icon{
						width: 97rpx;
						height: 97rpx;
						margin-left: -16rpx;
						margin-right: 20rpx;
					}
					&__center{
						display: flex;
						flex-direction: column;
						justify-content: center;
						
					}
					&__text{
						font-weight: 800;
						font-size: 27rpx;
						color: #181818;
						line-height: 27rpx;
						margin-bottom: 19rpx;
					}
					&__time{
						font-family: PingFang SC;
						font-weight: bold;
						font-size: 24rpx;
						color: #616161;
						line-height: 24rpx;
						opacity: 0.8;
					}
					&__price{
						font-family: DINNextLTPro-Bold;
						font-weight: bold;
						font-size: 34rpx;
						color: #FF4D30;
						line-height: 24rpx;
						margin-top: 22rpx;
					}
				}
			}
		}
	}
</style>